from Cookie import SimpleCookie
class Cookie(SimpleCookie):
    def __init__(self):
        self.new_cookies = []
    def to_headers(self):
        return self.new_cookies
    
    def put_cookie(self, key, value, domain):
        #print 'domain', domain
        self.new_cookies.append(('Set-Cookie', '%s=%s; Domain=%s; Path=/;'%(key, value, domain)))
    
    
    def get_cookie(self, key):
        return self[key].value